﻿using Kiosk.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Kiosk.Test
{
    
    
    /// <summary>
    ///This is a test class for LocationTest and is intended
    ///to contain all LocationTest Unit Tests
    ///</summary>
    [TestClass()]
    public class LocationTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for NewLocation
        ///</summary>
        [TestMethod()]
        public void NewLocationTest()
        {
            Location actual;
            actual = Location.NewLocation();
            actual.Name = "new loc";
            actual.XCoordinate = 50;
            actual.YCoordinate = 100;
            actual.Save();
        }

        /// <summary>
        ///A test for Location Read only list
        ///</summary>
        [TestMethod()]
        public void LocationFetchSingleTest()
        {
            LocationInfo l = LocationInfo.GetLocationInfoById(new Guid("{cffaf61f-7390-49f9-b34f-70ddf5f9384c}"));
            Assert.AreNotEqual(l, null);
        }

        /// <summary>
        ///A test for GetLocation
        ///</summary>
        [TestMethod()]
        public void GetLocationTest()
        {
            Guid id = new Guid("{cffaf61f-7390-49f9-b34f-70ddf5f9384c}"); // TODO: Initialize to an appropriate value
            Location actual;
            actual = Location.GetLocation(id);
            Assert.AreEqual("Nick Olson's Cube", actual.Name);
            Assert.AreEqual(50, actual.XCoordinate);
            Assert.AreEqual(100, actual.YCoordinate);
        }

        /// <summary>
        ///A test for Exists
        ///</summary>
        [TestMethod()]
        public void ExistsTest()
        {
            Guid id = new Guid("{d2f67bd4-4e4e-4249-9e6c-54089f6f6cad}"); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = Location.Exists(id);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for DeleteLocation
        ///</summary>
        [TestMethod()]
        public void DeleteLocationTest()
        {
            Guid id = new Guid("{d2f67bd4-4e4e-4249-9e6c-54089f6f6cad}"); // TODO: Initialize to an appropriate value
            Location.DeleteLocation(id);
            bool exists = Location.Exists(id);
            Assert.AreEqual(exists, false);

        }
    }
}
